package com.shopping_back.controller;

import com.shopping_back.common.Result;
import com.shopping_back.util.ResponseEnum;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static com.shopping_back.util.ResponseEnum.TOKEN_VERIFY_ERROR;
import static com.shopping_back.util.ResponseEnum.NO_TOKEN;

@RestController
@RequestMapping("/error")
public class ErrorController {

    @PostMapping("/token")
    public Result taken(String message) {
        return error(String.valueOf(NO_TOKEN));
    }

    @PostMapping("/tokenError")
    public Result error(String message) {
        return error(String.valueOf(TOKEN_VERIFY_ERROR));
    }
}